<?PHP exit('QQ:179667784');?>
<!--{template common/header}-->
<script src="template/qu_app/touch/style/share/soshm.min.js?{VERHASH}"></script>
<script src="template/qu_app/touch/style/audio/audio.min.js?{VERHASH}"></script>
<script>
//音频初始化
audiojs.events.ready(function() {
	audiojs.createAll();
});
</script>
<!--{eval $ahretable = 'forum_attachment_'.substr($_G['tid'], -1);}-->
<!--{eval $shareaid = DB::result_first("SELECT aid FROM ".DB::table($ahretable)." WHERE tid='$_G[tid]' AND isimage!='0'");}-->
<!--{if $shareaid}-->
<!--{eval $sharepic = getforumimg($shareaid,0,200,200)}-->
<!--{else}-->
<!--{eval $sharepic = 'template/qu_app/touch/style/share/share.jpg'}-->
<!--{/if}-->
<!--{eval require_once(DISCUZ_ROOT."./source/function/function_post.php");}-->
<!--{eval $sharesummary = messagecutstr(DB::result_first('SELECT `message` FROM '.DB::table('forum_post').' WHERE `tid` ='.$thread[tid].' AND `first` =1'),20);}-->

<script>
var sharetitle = '$_G[forum_thread][subject]';
var sharedesc = '$_G[forum][description]';
var sharelink = SITEURL + 'forum.php?mod=viewthread&tid=$thread[tid]';
var shareicon = SITEURL + '$sharepic';
</script>

<!--{if $_G['inajax'] == 1}-->
<!--{eval $postcount = 0;}-->
<!--{loop $postlist $post}-->
<!--{eval $needhiddenreply = ($hiddenreplies && $_G['uid'] != $post['authorid'] && $_G['uid'] != $_G['forum_thread']['authorid'] && !$post['first'] && !$_G['forum']['ismoderator']);}-->
<div class="plcnotfirst" id="pid$post[pid]">
<span class="avatar"><img src="<!--{if !$post['authorid'] || $post['anonymous']}--><!--{avatar(0, middle, true)}--><!--{else}--><!--{avatar($post[authorid], middle, true)}--><!--{/if}-->" /></span>
<div class="display pi">
	<ul class="authi">
		<li class="grey">
            <!--{if $_G['forum']['ismoderator']}-->
            <!-- manage start -->
               <a href="javascript:;" class="v_manage" onclick="ainuo_replyselect('$post[pid]')"><i class="iconfont icon-moreandroid"></i></a>
                
            <!-- manage end -->  
            <!--{/if}-->
            <!--{if $allowpostreply}-->
                <a id="replybtn_$post[pid]" class="v_reply" href="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]&repquote=$post[pid]&extra=$_GET[extra]&page=$page"><i class="iconfont icon-mark"></i></a>
            <!--{/if}-->
            <!--{if !$_G['forum_thread']['special'] && !$rushreply && !$hiddenreplies && $_G['setting']['repliesrank'] && !$post['first'] && !($post['isWater'] && $_G['setting']['filterednovote'])}-->
            <a class="y listzan external" href="javascript:;" onclick="listzan('$post[pid]')"><span id="review_support_$post[pid]">$post[postreview][support]</span><i class="iconfont icon-appreciate_light"></i></a>
            <!--{/if}-->
            
            <!--{if $post['authorid'] && $post['username'] && !$post['anonymous']}-->
                <a {if $isxiaoyunuser}href="javascript:;" onclick="sq.userCenter('$post[authorid]');"{else}href="home.php?mod=space&uid={$post[authorid]}&do=profile"{/if} class="ausize" {if $post[groupcolor]} style="color: $post[groupcolor]"{/if}>$post[author]</a> $authorverifys
            <span class="ainuo_first_level">Lv.$post['stars']</span>
            <!--{eval $_self = $thread['author'] && $post['author'] == $thread['author'] && $post['position'] !== '1';}-->
            <!--{if $_self}-->
                <span class="ainuo_first_louzhu">{lang thread_author}</span>
            <!--{/if}-->
            <!--{if $post['gender'] == 1}-->
            <i class="iconfont icon-male ainuo_first_genderm"></i>
            <!--{/if}-->
            <!--{if $post['gender'] == 2}-->
            <i class="iconfont icon-female ainuo_first_gendern"></i>
            <!--{/if}-->
            <!--{else}-->
                <!--{if !$post['authorid']}-->
                <a href="javascript:;">{lang guest} <em>$post[useip]{if $post[port]}:$post[port]{/if}</em></a>
                <!--{elseif $post['authorid'] && $post['username'] && $post['anonymous']}-->
                <!--{if $_G['forum']['ismoderator']}--><a href="home.php?mod=space&uid=$post[authorid]">{lang anonymous}</a><!--{else}-->{lang anonymous}<!--{/if}-->
                <!--{else}-->
                $post[author] <em>{lang member_deleted}</em>
                <!--{/if}-->
            <!--{/if}-->
        </li>
        <li class="grey rely">
            <span class="atopsecg">$post[dateline]&nbsp;<!--{if $post['status'] & 8}--><!--{if $_G['setting']['mobile']['mobilecomefrom']}-->{$_G['setting']['mobile']['mobilecomefrom']}<!--{else}-->{lang from_mobile}<!--{/if}--><!--{/if}--></span>
            
        </li>
	</ul>
            
	<div class="huifusize message">
		<h2><strong>$post[subject]</strong></h2>

        $post[message]
          
        <!--{if $_G['forum_thread']['special'] == 3 && ($_G['forum']['ismoderator'] && (!$_G['setting']['rewardexpiration'] || $_G['setting']['rewardexpiration'] > 0 && ($_G[timestamp] - $_G['forum_thread']['dateline']) / 86400 > $_G['setting']['rewardexpiration']) || $_G['forum_thread']['authorid'] == $_G['uid']) && $post['authorid'] != $_G['forum_thread']['authorid'] && $post['first'] == 0 && $_G['uid'] != $post['authorid'] && $_G['forum_thread']['price'] > 0}-->
            <p class="ainuo_bestanw cl"><a class="formdialog" href="javascript:;" onclick="setanswer($post['pid'], '$_GET[from]')">$alang_bestanw</a></p>
        <!--{/if}-->
	</div>
	<!--{if $_G['setting']['mobile']['mobilesimpletype'] == 0}-->
        <!--{if $post['attachment']}-->
			<div class="grey ainuo_vquote">
				{lang attachment}: <em><!--{if $_G['uid']}-->{lang attach_nopermission}<!--{else}-->{lang attach_nopermission_login}<!--{/if}--></em>
			</div>
        <!--{elseif $post['imagelist'] || $post['attachlist']}-->
           <!--{if $post['imagelist']}-->
            <!--{if count($post['imagelist']) == 1}-->
            <ul class="img_one">{echo showattach($post, 1)}</ul>
            <!--{else}-->
            <ul class="img_list cl vm">{echo showattach($post, 1)}</ul>
            <!--{/if}-->
            <!--{/if}-->
            <!--{if $post['attachlist']}-->
            <ul>{echo showattach($post)}</ul>
            <!--{/if}-->
        <!--{/if}-->
	<!--{/if}-->
</div>
</div>
<!--{/loop}-->

<!--{else}-->

<!--{eval require_once(DISCUZ_ROOT."./template/qu_app/touch/ainuo/select.php");}-->
{eval $allreply = $_G[forum_thread][allreplies]}
<!--{if in_array($_G['fid'], $ainuo_ary_videolist)}-->
	<!--{template forum/v_video}-->
<!--{elseif in_array($_G['fid'], $ainuo_ary_tradelist)}-->
	<!--{template forum/v_trade}-->
<!--{else}-->
	<!--{template forum/viewthread_normal}-->
<!--{/if}-->

<script type="text/javascript">
$('.favbtn').on('click', function() {
	<!--{if !$_G[uid]}-->
		popup.open('{lang nologin_tip}', 'confirm', 'member.php?mod=logging&action=login');
		return false;
	<!--{/if}-->
	$('body').append('<div class="ainuooverlay"><div class="loadings_icon"><i class="toast-loading toast-icon_toast"></i></div></div>');
	var obj = $(this);
	$.ajax({
		type:'POST',
		url:'home.php?mod=spacecp&ac=favorite&type=thread&id=$_G[tid]&handlekey=favbtn&inajax=1',
		data:{'favoritesubmit':'true', 'formhash':'{FORMHASH}'},
		dataType:'xml',
	})
	.success(function(s) {
		if(s.lastChild.firstChild.nodeValue.indexOf("$alang_haveshoucang") >= 0){
			$('.ainuooverlay').remove();
			showMessage('$alang_haveshoucang');
		}else if(s.lastChild.firstChild.nodeValue.indexOf("$alang_havescsucccess") >= 0){
			$(".favbtn .iconfont").removeClass("icon-favor");
			$(".favbtn .iconfont").addClass("icon-favorfill");
			$('.ainuooverlay').remove();
			showMessage('$alang_havescsucccess2');
		}
	})
	.error(function() {
		window.location.href = obj.attr('href');
		$('.ainuooverlay').remove();
	});
	return false;
});
function listzan(apid) {
	<!--{if !$_G[uid]}-->
		popup.open('{lang nologin_tip}', 'confirm', 'member.php?mod=logging&action=login');
		return false;
	<!--{/if}-->
	var obj = $(this);
	$('body').append('<div class="ainuooverlay"><div class="loadings_icon"><i class="toast-loading toast-icon_toast"></i></div></div>');
	$.ajax({
		type : 'GET',
		url : 'forum.php?mod=misc&action=postreview&do=support&tid=$_G[tid]&pid='+apid+'&hash={FORMHASH}&inajax=1',
		dataType : 'xml'
	})
	.success(function(s) {
		if(s.lastChild.firstChild.nodeValue.indexOf("$alang_nbntp") >= 0){
			$('.ainuooverlay').remove();
			showMessage('$alang_nbndzo');
		}else if(s.lastChild.firstChild.nodeValue.indexOf("$alang_nyjtp") >= 0){
			$('.ainuooverlay').remove();
			showMessage('$alang_nyjzg');
		}else{
			$('.ainuooverlay').remove();
			showMessage('$alang_dzcg');
			if(document.getElementById("review_support_"+apid).innerHTML){
				setTimeout((document.getElementById("review_support_"+apid).innerHTML = parseInt(document.getElementById("review_support_"+apid).innerHTML) + 1),500);
			}else{
				document.getElementById("review_support_"+apid).innerHTML = 1;
			}
		}
		
	})
	
	.error(function() {
		window.location.href = obj.attr('href');
		$('.ainuooverlay').remove();
	});
	
	return false;
	
};
$('.ainuozan').on('click', function() {
	<!--{if !$_G[uid]}-->
		popup.open('{lang nologin_tip}', 'confirm', 'member.php?mod=logging&action=login');
		return false;
	<!--{/if}-->
	var obj = $(this);
	$('body').append('<div class="ainuooverlay"><div class="loadings_icon"><i class="toast-loading toast-icon_toast"></i></div></div>');
	$.ajax({
		type : 'GET',
		url:'forum.php?mod=misc&action=recommend&do=add&tid=$_G[tid]&hash={FORMHASH}&inajax=1',
		dataType : 'xml'
	})
	.success(function(s) {
		if(s.lastChild.firstChild.nodeValue.indexOf("$alang_yipingjia") >= 0){
			$('.ainuooverlay').remove();
			showMessage('$alang_dianzanguo');
		}else if(s.lastChild.firstChild.nodeValue.indexOf("$alang_zanjiayi") >= 0){
			setTimeout((document.getElementById("ainuozannum").innerHTML = parseInt(document.getElementById("ainuozannum").innerHTML) + 1),500);
			$(".ainuozan .iconfont").removeClass("icon-appreciate");
			$(".ainuozan .iconfont").addClass("icon-appreciatefill");
			$('.ainuooverlay').remove();
			showMessage('$alang_zanjiayi2');
		}else if(s.lastChild.firstChild.nodeValue.indexOf("\u60a8\u76ee\u524d\u6ca1\u6709\u6743\u9650\u8bc4\u4ef7\u6b64\u4e3b\u9898") >= 0){
			$('.ainuooverlay').remove();
			showMessage('\u8bf7\u5148\u52a0\u5165\u8be5\u7fa4\u7ec4');
		}else if(s.lastChild.firstChild.nodeValue.indexOf("\u60a8\u4e0d\u80fd\u8bc4\u4ef7\u81ea\u5df1\u7684\u5e16\u5b50") >= 0){
			$('.ainuooverlay').remove();
			showMessage('\u60a8\u4e0d\u80fd\u7ed9\u81ea\u5df1\u70b9\u8d5e');
		}else{
			$('.ainuooverlay').remove();
			popup.open(s.lastChild.firstChild.nodeValue);
			evalscript(s.lastChild.firstChild.nodeValue);
		}
	})
	return false;
	
});

function setanswer(pid, from){
	if(confirm('$alang_zjda')){
		document.getElementById('modactions').action='forum.php?mod=misc&action=bestanswer&tid=' + tid + '&pid=' + pid + '&from=' + from + '&bestanswersubmit=yes';
		var obj = $('#modactions');
		$.ajax({
			type:'POST',
			url:obj.attr('action') + '&inajax=1',
			data:obj.serialize(),
			dataType:'xml'
		})
		.success(function(s) {
			popup.open(s.lastChild.firstChild.nodeValue);
			evalscript(s.lastChild.firstChild.nodeValue);
		})
		.error(function() {
			window.location.href = obj.attr('href');
			popup.close();
		});		
	}
};

function ainuo_replyselect(pid) {
	$.actions({
	  title: "$alang_select",
	  onClose: function() {
		console.log("close");
	  },
	  actions: [
		{
		  text: "{lang edit}",
		  className: "color-primary",
		  onClick: function() {
			window.location.href = 'forum.php?mod=post&action=edit&fid=$_G[fid]&tid=$_G[tid]&pid='+pid+'{if !empty($_GET[modthreadkey])}&modthreadkey=$_GET[modthreadkey]{/if}&page=$page';
		  }
		},
		<!--{if $_G['group']['allowdelpost']}-->
		  {
			text: '{lang modmenu_deletepost}',
			onClick: function() {
				var deleteurl = 'forum.php?mod=topicadmin&action=delpost&fid={$_G[fid]}&tid={$_G[tid]}&operation=&optgroup=&page=&topiclist[]='+pid;
				ainuoajax(deleteurl);
			}
		  },
		  <!--{/if}-->
	  ]
	});
}

function ainuo_adminmanage(pid) {
	$.actions({
	  title: "$alang_select",
	  onClose: function() {
		console.log("close");
	  },
	  actions: [

		  {
			text: '{lang delete}',
			onClick: function() {
				var adeleteurl = 'forum.php?mod=topicadmin&action=moderate&fid={$_G[fid]}&moderate[]={$_G[tid]}&operation=delete&optgroup=3&from={$_G[tid]}';
				ainuoajax(adeleteurl);
			}
		  },
		  {
			text: '{lang close}',
			onClick: function() {
				var acloseurl = 'forum.php?mod=topicadmin&action=moderate&fid={$_G[fid]}&moderate[]={$_G[tid]}&from={$_G[tid]}&optgroup=4';
				ainuoajax(acloseurl);
			}
		  },
		]
	});
}
function ainuoajax(aurl){
	$('body').append('<div class="ainuooverlay"><div class="loadings_icon"><i class="toast-loading toast-icon_toast"></i></div></div>');
	$.ajax({
		type : 'GET',
		url: aurl,
		dataType : 'xml'
	})
	.success(function(s) {
		popup.open(s.lastChild.firstChild.nodeValue);
		evalscript(s.lastChild.firstChild.nodeValue);
		$('.ainuooverlay').remove();
	})
	.error(function() {
		$('.ainuooverlay').remove();
		showMessage('$alang_pleasetye');
	});
	return false;
}
function submitpostpw(pid, tid) {
	var obj = document.getElementById('postpw_' + pid);
	setcookie('postpw_' + pid, hex_md5(obj.value));
	if(!tid) {
		location.href = location.href;
	} else {
		location.href = 'forum.php?mod=viewthread&tid='+tid;
	}
}
</script>

<!--{template common/sharef}-->
<script>
	var ainuo_forum_html = '';
	var ainuo_forum_empty = '<div class="inner">$alang_nomore</div>';
	var ainuo_forum_emptyfail = '<div class="inner">$alang_loadfail</div>';				
	var ainuo_forum_loading = false;
	var ainuo_forum_aperpage = $_G['ppp'];
	var amaxnum = $allreply;
	var ainuo_forum_ainuomaxpage = Math.ceil(amaxnum / ainuo_forum_aperpage);
	var ainuo_forum_url = 'forum.php?mod=viewthread&tid=$_G[tid]&page=';
</script>
{if $pagestyle == 1}
<script src="template/qu_app/touch/style/load/loadview.js"></script>
{/if}

	<link href="template/qu_app/touch/style/weui/weui.min.css?{VERHASH}" rel="stylesheet"/>
    <link href="template/qu_app/touch/style/weui/jquery-weui.css?{VERHASH}" rel="stylesheet"/>
    <script src="template/qu_app/touch/style/weui/jquery-weui.min.js"></script>
    
<!--{/if}-->

<script src="template/qu_app/touch/style/zoom/zoomerang.js"></script>
<script>
/*	Array.prototype.forEach.call(document.querySelectorAll('p'), function (p, i) {
		p.style.marginLeft = i * 6 + '%'
	})*/
	Zoomerang
		.config({
			maxHeight: 400,
			maxWidth: 400,
			bgColor: '#000',
			bgOpacity: .85,
			onOpen: openCallback,
			onClose: closeCallback,
			onBeforeOpen: beforeOpenCallback,
			onBeforeClose: beforeCloseCallback
		})
		.listen('.zoom')

	function openCallback (el) {
		console.log('zoomed in on: ')
		console.log(el)
	}

	function closeCallback (el) {
		console.log('zoomed out on: ')
		console.log(el)
	}

	function beforeOpenCallback (el) {
		console.log('on before zoomed in on:')
		console.log(el)
	}

	function beforeCloseCallback (el) {
		console.log('on before zoomed out on:')
		console.log(el)
	}

</script>
<!--{eval $nofooter = true;}-->

<!--{template common/footer}-->
